package model

import "api/database"

/**
 * @Description
 * @Author huan.wang
 * @Date 2021/5/7 6:16 下午
 **/

type DeviceTypeModel struct {
	BaseModel
	ID   uint `gorm:"primary_key"`
	Name string `gorm:"column:name"`
}

func NewDeviceTypeModel() *DeviceTypeModel {
	return &DeviceTypeModel{}
}

func (DeviceTypeModel) TableName() string {
	return "device_type"
}

func (dt DeviceTypeModel) Select() (dts []DeviceTypeModel) {
	database.GetDB().Model(&dt).Find(&dts)
	return
}
